home *** CD-ROM | disk | FTP | other *** search
/ Aminet 5 / Aminet 5 - March 1995.iso / Aminet / util / gnu / a2_0bEmacs_bin.lha / Emacs-19.25 / info / emacs-1 (.txt) < prev    next >
GNU Info File  |  1992-02-21  |  49KB  |  831 lines

  1. This is Info file ../info/emacs, produced by Makeinfo-1.43 from the
  2. input file emacs.tex.
  3.    This file documents the GNU Emacs editor.
  4.    Copyright (C) 1985, 1986, 1988 Richard M. Stallman.
  5.    Permission is granted to make and distribute verbatim copies of
  6. this manual provided the copyright notice and this permission notice
  7. are preserved on all copies.
  8.    Permission is granted to copy and distribute modified versions of
  9. this manual under the conditions for verbatim copying, provided also
  10. that the sections entitled "The GNU Manifesto", "Distribution" and "GNU
  11. General Public License" are included exactly as in the original, and
  12. provided that the entire resulting derived work is distributed under
  13. the terms of a permission notice identical to this one.
  14.    Permission is granted to copy and distribute translations of this
  15. manual into another language, under the above conditions for modified
  16. versions, except that the sections entitled "The GNU Manifesto",
  17. "Distribution" and "GNU General Public License" may be included in a
  18. translation approved by the author instead of in the original English.
  19. File: emacs,  Node: Top,  Next: Distrib,  Up: (DIR)
  20.    The Emacs Editor ****************
  21.    Emacs is the extensible, customizable, self-documenting real-time
  22. display editor.  This Info file describes how to edit with Emacs and
  23. some of how to customize it, but not how to extend it.
  24. * Menu:
  25. * Distrib::     How to get the latest Emacs distribution.
  26. * License::     The GNU General Public License gives you permission
  27.         to redistribute GNU Emacs on certain terms; and also
  28.         explains that there is no warranty.
  29. * Intro::       An introduction to Emacs concepts.
  30. * Glossary::    The glossary.
  31. * Manifesto::   What's GNU?  Gnu's Not Unix!
  32. Indexes, nodes containing large menus
  33. * Key Index::      An item for each standard Emacs key sequence.
  34. * Command Index::  An item for each command name.
  35. * Variable Index:: An item for each documented variable.
  36. * Concept Index::  An item for each concept.
  37. Important General Concepts
  38. * Screen::      How to interpret what you see on the screen.
  39. * Characters::  Emacs's character sets for file contents and for keyboard.
  40. * Keys::        Key sequences: what you type to request one editing action.
  41. * Commands::    Commands: named functions run by key sequences to do editing.
  42. * Entering Emacs::    Starting Emacs from the shell.
  43. * Command Switches::  Hairy startup options.
  44. * Exiting::     Stopping or killing Emacs.
  45. * Basic::       The most basic editing commands.
  46. * Undo::        Undoing recently made changes in the text.
  47. * Minibuffer::  Entering arguments that are prompted for.
  48. * M-x::         Invoking commands by their names.
  49. * Help::        Commands for asking Emacs about its commands.
  50. Important Text-Changing Commands
  51. * Mark::        The mark: how to delimit a "region" of text.
  52. * Killing::     Killing text.
  53. * Yanking::     Recovering killed text.  Moving text.
  54. * Accumulating Text::
  55.                 Other ways of copying text.
  56. * Rectangles::  Operating on the text inside a rectangle on the screen.
  57. * Registers::   Saving a text string or a location in the buffer.
  58. * Display::     Controlling what text is displayed.
  59. * Search::      Finding or replacing occurrences of a string.
  60. * Fixit::       Commands especially useful for fixing typos.
  61. Larger Units of Text
  62. * Files::       All about handling files.
  63. * Buffers::     Multiple buffers; editing several files at once.
  64. * Windows::     Viewing two pieces of text at once.
  65. Advanced Features
  66. * Major Modes:: Text mode vs. Lisp mode vs. C mode ...
  67. * Indentation:: Editing the white space at the beginnings of lines.
  68. * Text::        Commands and modes for editing English.
  69. * Programs::    Commands and modes for editing programs.
  70. * Running::     Compiling, running and debugging programs.
  71. * Abbrevs::     How to define text abbreviations to reduce
  72.                  the number of characters you must type.
  73. * Picture::     Editing pictures made up of characters
  74.                  using the quarter-plane screen model.
  75. * Sending Mail::Sending mail in Emacs.
  76. * Rmail::       Reading mail in Emacs.
  77. * Recursive Edit::
  78.                 A command can allow you to do editing
  79.                  "within the command".  This is called a
  80.                  `recursive editing level'.
  81. * Narrowing::   Restricting display and editing to a portion
  82.                  of the buffer.
  83. * Sorting::    Sorting lines, paragraphs or pages within Emacs.
  84. * Shell::       Executing shell commands from Emacs.
  85. * Hardcopy::    Printing buffers or regions.
  86. * Dissociated Press::  Dissociating text for fun.
  87. * Amusements::         Various games and hacks.
  88. * Emulation::           Emulating some other editors with Emacs.
  89. * Customization::      Modifying the behavior of Emacs.
  90. Recovery from Problems.
  91. * Quitting::    Quitting and aborting.
  92. * Lossage::     What to do if Emacs is hung or malfunctioning.
  93. * Bugs::        How and when to report a bug.
  94. Here are some other nodes which are really inferiors of the ones
  95. already listed, mentioned here so you can get to them in one step:
  96. Subnodes of Screen
  97. * Point::    The place in the text where editing commands operate.
  98. * Echo Area::   Short messages appear at the bottom of the screen.
  99. * Mode Line::    Interpreting the mode line.
  100. Subnodes of Basic
  101. * Blank Lines:: Commands to make or delete blank lines.
  102. * Continuation Lines:: Lines too wide for the screen.
  103. * Position Info::      What page, line, row, or column is point on?
  104. * Arguments::          Giving numeric arguments to commands.
  105. Subnodes of Minibuffer
  106. * Minibuffer File::    Entering file names with the minibuffer.
  107. * Minibuffer Edit::    How to edit in the minibuffer.
  108. * Completion::  An abbreviation facility for minibuffer input.
  109. * Repetition::  Re-executing previous commands that used the minibuffer.
  110. Subnodes of Mark
  111. * Setting Mark::       Commands to set the mark.
  112. * Using Region::       Summary of ways to operate on contents of the region.
  113. * Marking Objects::    Commands to put region around textual units.
  114. * Mark Ring::          Previous mark positions saved so you can go back there.
  115. Subnodes of Yanking
  116. * Kill Ring::          Where killed text is stored.  Basic yanking.
  117. * Appending Kills::    Several kills in a row all yank together.
  118. * Earlier Kills::      Yanking something killed some time ago.
  119. Subnodes of Registers
  120. * RegPos::             Saving positions in registers.
  121. * RegText::            Saving text in registers.
  122. * RegRect::            Saving rectangles in registers.
  123. Subnodes of Display
  124. * Scrolling::               Moving text up and down in a window.
  125. * Horizontal Scrolling::   Moving text left and right in a window.
  126. * Selective Display::      Hiding lines with lots of indentation.
  127. * Display Vars::           Information on variables for customizing display.
  128. Subnodes of Search
  129. * Incremental Search::     Search happens as you type the string.
  130. * Nonincremental Search::  Specify entire string and then search.
  131. * Word Search::        Search for sequence of words.
  132. * Regexp Search::       Search for match for a regexp.
  133. * Regexps::            Syntax of regular expressions.
  134. * Search Case::           To ignore case while searching, or not.
  135. * Replace::            Search, and replace some or all matches.
  136. * Unconditional Replace::  Everything about replacement except for querying.
  137. * Query Replace::          How to use querying.
  138. * Other Repeating Search:: Operating on all matches for some regexp.
  139. Subnodes of Fixit
  140. * Kill Errors:: Commands to kill a batch of recently entered text.
  141. * Transpose::   Exchanging two characters, words, lines, lists...
  142. * Fixing Case:: Correcting case of last word entered.
  143. * Spelling::    Apply spelling checker to a word, or a whole file.
  144. Subnodes of Files
  145. * File Names::  How to type and edit file name arguments.
  146. * Visiting::    Visiting a file prepares Emacs to edit the file.
  147. * Saving::      Saving makes your changes permanent.
  148. * Backup::      How Emacs saves the old version of your file.
  149. * Interlocking::How Emacs protects against simultaneous editing
  150.                  of one file by two users.
  151. * Reverting::   Reverting cancels all the changes not saved.
  152. * Auto Save::   Auto Save periodically protects against loss of data.
  153. * ListDir::     Listing the contents of a file directory.
  154. * Dired::       "Editing" a directory to delete, rename, etc.
  155.                  the files in it.
  156. * Misc File Ops:: Other things you can do on files.
  157. Subnodes of Buffers
  158. * Select Buffer::   Creating a new buffer or reselecting an old one.
  159. * List Buffers::    Getting a list of buffers that exist.
  160. * Misc Buffer::     Renaming; changing read-only status.
  161. * Kill Buffer::     Killing buffers you no longer need.
  162. * Several Buffers:: How to go through the list of all buffers
  163.                      and operate variously on several of them.
  164. Subnodes of Windows
  165. * Basic Window::    Introduction to Emacs windows.
  166. * Split Window::    New windows are made by splitting existing windows.
  167. * Other Window::    Moving to another window or doing something to it.
  168. * Pop Up Window::   Finding a file or buffer in another window.
  169. * Change Window::   Deleting windows and changing their sizes.
  170. Subnodes of Indentation
  171. * Indentation Commands:: Various commands and techniques for indentation.
  172. * Tab Stops::   You can set arbitrary "tab stops" and then
  173.                  indent to the next tab stop when you want to.
  174. * Just Spaces:: You can request indentation using just spaces.
  175. Subnodes of Text
  176. * Text Mode::   The major mode for editing text files.
  177. * Nroff Mode::  The major mode for editing input to the formatter nroff.
  178. * TeX Mode::    The major mode for editing input to the formatter TeX.
  179. * Outline Mode::The major mode for editing outlines.
  180. * Words::       Moving over and killing words.
  181. * Sentences::   Moving over and killing sentences.
  182. * Paragraphs::    Moving over paragraphs.
  183. * Pages::    Moving over pages.
  184. * Filling::     Filling or justifying text
  185. * Case::        Changing the case of text
  186. Subnodes of Programs
  187. * Program Modes::       Major modes for editing programs.
  188. * Lists::       Expressions with balanced parentheses.
  189.                  There are editing commands to operate on them.
  190. * Defuns::      Each program is made up of separate functions.
  191.                  There are editing commands to operate on them.
  192. * Grinding::    Adjusting indentation to show the nesting.
  193. * Matching::    Insertion of a close-delimiter flashes matching open.
  194. * Comments::    Inserting, illing and aligning comments.
  195. * Balanced Editing::    Inserting two matching parentheses at once, etc.
  196. * Lisp Completion::     Completion on symbol names in Lisp code.
  197. * Documentation::       Getting documentation of functions you plan to call.
  198. * Change Log::  Maintaining a change history for your program.
  199. * Tags::        Go direct to any function in your program in one
  200.                  command.  Tags remembers which file it is in.
  201. * Fortran::    Fortran mode and its special features.
  202. Subnodes of Running
  203. * Compilation::       Compiling programs in languages other than Lisp
  204.                        (C, Pascal, etc.)
  205. * Lisp Modes::        Various modes for editing Lisp programs, with
  206.                        different facilities for running the Lisp programs.
  207. * Lisp Libraries::    Creating Lisp programs to run in Emacs.
  208. * Lisp Interaction::  Executing Lisp in an Emacs buffer.
  209. * Lisp Eval::         Executing a single Lisp expression in Emacs.
  210. * Lisp Debug::        Debugging Lisp programs running in Emacs.
  211. * External Lisp::     Communicating through Emacs with a separate Lisp.
  212. Subnodes of Abbrevs
  213. * Defining Abbrevs::  Defining an abbrev, so it will expand when typed.
  214. * Expanding Abbrevs:: Controlling expansion: prefixes, canceling expansion.
  215. * Editing Abbrevs::   Viewing or editing the entire list of defined abbrevs.
  216. * Saving Abbrevs::    Saving the entire list of abbrevs for another session.
  217. * Dynamic Abbrevs::   Abbreviations for words already in the buffer.
  218. Subnodes of Picture
  219. * Basic Picture::     Basic concepts and simple commands of Picture Mode.
  220. * Insert in Picture:: Controlling direction of cursor motion
  221.                        after "self-inserting" characters.
  222. * Tabs in Picture::   Various features for tab stops and indentation.
  223. * Rectangles in Picture:: Clearing and superimposing rectangles.
  224. Subnodes of Sending Mail
  225. * Mail Format::       Format of the mail being composed.
  226. * Mail Headers::      Details of allowed mail header fields.
  227. * Mail Mode::         Special commands for editing mail being composed.
  228. Subnodes of Rmail
  229. * Rmail Scrolling::   Scrolling through a message.
  230. * Rmail Motion::      Moving to another message.
  231. * Rmail Deletion::    Deleting and expunging messages.
  232. * Rmail Inbox::       How mail gets into the Rmail file.
  233. * Rmail Files::       Using multiple Rmail files.
  234. * Rmail Output::      Copying message out to files.
  235. * Rmail Labels::      Classifying messages by labeling them.
  236. * Rmail Summary::     Summaries show brief info on many messages.
  237. * Rmail Reply::       Sending replies to messages you are viewing.
  238. * Rmail Editing::     Editing message text and headers in Rmail.
  239. * Rmail Digest::      Extracting the messages from a digest message.
  240. Subnodes of Shell
  241. * Single Shell::      Commands to run one shell command and return.
  242. * Interactive Shell:: Permanent shell taking input via Emacs.
  243. * Shell Mode::        Special Emacs commands used with permanent shell.
  244. Subnodes of Customization
  245. * Minor Modes::       Each minor mode is one feature you can turn on
  246.                        independently of any others.
  247. * Variables::         Many Emacs commands examine Emacs variables
  248.                        to decide what to do; by setting variables,
  249.                        you can control their functioning.
  250. * Examining::         Examining or setting one variable's value.
  251. * Edit Options::      Examining or editing list of all variables' values.
  252. * Locals::            Per-buffer values of variables.
  253. * File Variables::    How files can specify variable values.
  254. * Keyboard Macros::   A keyboard macro records a sequence of keystrokes
  255.                        to be replayed with a single command.
  256. * Key Bindings::      The keymaps say what command each key runs.
  257.                        By changing them, you can "redefine keys".
  258. * Keymaps::           Definition of the keymap data structure.
  259. * Rebinding::         How to redefine one key's meaning conveniently.
  260. * Disabling::         Disabling a command means confirmation is required
  261.                        before it can be executed.  This is done to protect
  262.                        beginners from surprises.
  263. * Syntax::            The syntax table controls how words and expressions
  264.                        are parsed.
  265. * Init File::         How to write common customizations in the `.emacs' file.
  266. Subnodes of Lossage (and recovery)
  267. * Stuck Recursive::   `[...]' in mode line around the parentheses.
  268. * Screen Garbled::    Garbage on the screen.
  269. * Text Garbled::      Garbage in the text.
  270. * Unasked-for Search::Spontaneous entry to incremental search.
  271. * Emergency Escape::  Emergency escape--
  272.                        What to do if Emacs stops responding.
  273. * Total Frustration:: When you are at your wits' end.
  274. File: emacs,  Node: Distrib,  Next: License,  Prev: Top,  Up: Top
  275. Distribution
  276. ************
  277.    GNU Emacs is "free"; this means that everyone is free to use it and
  278. free to redistribute it on a free basis.  GNU Emacs is not in the
  279. public domain; it is copyrighted and there are restrictions on its
  280. distribution, but these restrictions are designed to permit everything
  281. that a good cooperating citizen would want to do.  What is not allowed
  282. is to try to prevent others from further sharing any version of GNU
  283. Emacs that they might get from you.  The precise conditions are found
  284. in the GNU General Public License that comes with Emacs and also
  285. appears following this section.
  286.    The easiest way to get a copy of GNU Emacs is from someone else who
  287. has it.  You need not ask for permission to do so, or tell any one
  288. else; just copy it.
  289.    If you have access to the Internet, you can get the latest
  290. distribution version of GNU Emacs from host `prep.ai.mit.edu' using
  291. anonymous login.  See the file `/u2/emacs/GETTING.GNU.SOFTWARE' on
  292. that host to find out about your options for copying and which files
  293. to use.
  294.    You may also receive GNU Emacs when you buy a computer.  Computer
  295. manufacturers are free to distribute copies on the same terms that
  296. apply to everyone else.  These terms require them to give you the full
  297. sources, including whatever changes they may have made, and to permit
  298. you to redistribute the GNU Emacs received from them under the usual
  299. terms of the General Public License.  In other words, the program must
  300. be free for you when you get it, not just free for the manufacturer.
  301.    If you cannot get a copy in any of those ways, you can order one
  302. from the Free Software Foundation.  Though Emacs itself is free, our
  303. distribution service is not.  An order form is included at the end of
  304. manuals printed by the Foundation.  It is also included in the file
  305. `etc/DISTRIB' in the Emacs distribution.  For further information,
  306. write to
  307.      Free Software Foundation
  308.      675 Mass Ave
  309.      Cambridge, MA 02139
  310.      USA
  311.    The income from distribution fees goes to support the foundation's
  312. purpose: the development of more free software to distribute just like
  313. GNU Emacs.
  314.    If you find GNU Emacs useful, please send a donation to the Free
  315. Software Foundation.  This will help support development of the rest
  316. of the GNU system, and other useful software beyond that.  Your
  317. donation is tax deductible.
  318. File: emacs,  Node: License,  Next: Intro,  Prev: Distrib,  Up: Top
  319. GNU GENERAL PUBLIC LICENSE
  320. **************************
  321.                          Version 1, February 1989
  322.      Copyright (C) 1989 Free Software Foundation, Inc.
  323.      675 Mass Ave, Cambridge, MA 02139, USA
  324.      
  325.      Everyone is permitted to copy and distribute verbatim copies
  326.      of this license document, but changing it is not allowed.
  327. Preamble
  328. ========
  329.    The license agreements of most software companies try to keep users
  330. at the mercy of those companies.  By contrast, our General Public
  331. License is intended to guarantee your freedom to share and change free
  332. software--to make sure the software is free for all its users.  The
  333. General Public License applies to the Free Software Foundation's
  334. software and to any other program whose authors commit to using it. 
  335. You can use it for your programs, too.
  336.    When we speak of free software, we are referring to freedom, not
  337. price.  Specifically, the General Public License is designed to make
  338. sure that you have the freedom to give away or sell copies of free
  339. software, that you receive source code or can get it if you want it,
  340. that you can change the software or use pieces of it in new free
  341. programs; and that you know you can do these things.
  342.    To protect your rights, we need to make restrictions that forbid
  343. anyone to deny you these rights or to ask you to surrender the rights. 
  344. These restrictions translate to certain responsibilities for you if you
  345. distribute copies of the software, or if you modify it.
  346.    For example, if you distribute copies of a such a program, whether
  347. gratis or for a fee, you must give the recipients all the rights that
  348. you have.  You must make sure that they, too, receive or can get the
  349. source code.  And you must tell them their rights.
  350.    We protect your rights with two steps: (1) copyright the software,
  351. and (2) offer you this license which gives you legal permission to
  352. copy, distribute and/or modify the software.
  353.    Also, for each author's protection and ours, we want to make certain
  354. that everyone understands that there is no warranty for this free
  355. software.  If the software is modified by someone else and passed on,
  356. we want its recipients to know that what they have is not the
  357. original, so that any problems introduced by others will not reflect
  358. on the original authors' reputations.
  359.    The precise terms and conditions for copying, distribution and
  360. modification follow.
  361.                            TERMS AND CONDITIONS
  362.   1. This License Agreement applies to any program or other work which
  363.      contains a notice placed by the copyright holder saying it may be
  364.      distributed under the terms of this General Public License.  The
  365.      "Program", below, refers to any such program or work, and a "work
  366.      based on the Program" means either the Program or any work
  367.      containing the Program or a portion of it, either verbatim or
  368.      with modifications.  Each licensee is addressed as "you".
  369.   2. You may copy and distribute verbatim copies of the Program's
  370.      source code as you receive it, in any medium, provided that you
  371.      conspicuously and appropriately publish on each copy an
  372.      appropriate copyright notice and disclaimer of warranty; keep
  373.      intact all the notices that refer to this General Public License
  374.      and to the absence of any warranty; and give any other recipients
  375.      of the Program a copy of this General Public License along with
  376.      the Program.  You may charge a fee for the physical act of
  377.      transferring a copy.
  378.   3. You may modify your copy or copies of the Program or any portion
  379.      of it, and copy and distribute such modifications under the terms
  380.      of Paragraph 1 above, provided that you also do the following:
  381.         * cause the modified files to carry prominent notices stating
  382.           that you changed the files and the date of any change; and
  383.         * cause the whole of any work that you distribute or publish,
  384.           that in whole or in part contains the Program or any part
  385.           thereof, either with or without modifications, to be
  386.           licensed at no charge to all third parties under the terms
  387.           of this General Public License (except that you may choose
  388.           to grant warranty protection to some or all third parties,
  389.           at your option).
  390.         * If the modified program normally reads commands
  391.           interactively when run, you must cause it, when started
  392.           running for such interactive use in the simplest and most
  393.           usual way, to print or display an announcement including an
  394.           appropriate copyright notice and a notice that there is no
  395.           warranty (or else, saying that you provide a warranty) and
  396.           that users may redistribute the program under these
  397.           conditions, and telling the user how to view a copy of this
  398.           General Public License.
  399.         * You may charge a fee for the physical act of transferring a
  400.           copy, and you may at your option offer warranty protection in
  401.           exchange for a fee.
  402.         Mere aggregation of another independent work with the Program
  403.      (or its derivative) on a volume of a storage or distribution
  404.      medium does not bring the other work under the scope of these
  405.      terms.
  406.   4. You may copy and distribute the Program (or a portion or
  407.      derivative of it, under Paragraph 2) in object code or executable
  408.      form under the terms of Paragraphs 1 and 2 above provided that
  409.      you also do one of the following:
  410.         * accompany it with the complete corresponding machine-readable
  411.           source code, which must be distributed under the terms of
  412.           Paragraphs 1 and 2 above; or,
  413.         * accompany it with a written offer, valid for at least three
  414.           years, to give any third party free (except for a nominal
  415.           charge for the cost of distribution) a complete
  416.           machine-readable copy of the corresponding source code, to
  417.           be distributed under the terms of Paragraphs 1 and 2 above;
  418.           or,
  419.         * accompany it with the information you received as to where
  420.           the corresponding source code may be obtained.  (This
  421.           alternative is allowed only for noncommercial distribution
  422.           and only if you received the program in object code or
  423.           executable form alone.)
  424.         Source code for a work means the preferred form of the work
  425.      for making modifications to it.  For an executable file, complete
  426.      source code means all the source code for all modules it
  427.      contains; but, as a special exception, it need not include source
  428.      code for modules which are standard libraries that accompany the
  429.      operating system on which the executable file runs, or for
  430.      standard header files or definitions files that accompany that
  431.      operating system.
  432.   5. You may not copy, modify, sublicense, distribute or transfer the
  433.      Program except as expressly provided under this General Public
  434.      License.  Any attempt otherwise to copy, modify, sublicense,
  435.      distribute or transfer the Program is void, and will
  436.      automatically terminate your rights to use the Program under this
  437.      License.  However, parties who have received copies, or rights to
  438.      use copies, from you under this General Public License will not
  439.      have their licenses terminated so long as such parties remain in
  440.      full compliance.
  441.   6. By copying, distributing or modifying the Program (or any work
  442.      based on the Program) you indicate your acceptance of this
  443.      license to do so, and all its terms and conditions.
  444.   7. Each time you redistribute the Program (or any work based on the
  445.      Program), the recipient automatically receives a license from the
  446.      original licensor to copy, distribute or modify the Program
  447.      subject to these terms and conditions.  You may not impose any
  448.      further restrictions on the recipients' exercise of the rights
  449.      granted herein.
  450.   8. The Free Software Foundation may publish revised and/or new
  451.      versions of the General Public License from time to time.  Such
  452.      new versions will be similar in spirit to the present version,
  453.      but may differ in detail to address new problems or concerns.
  454.         Each version is given a distinguishing version number.  If the
  455.      Program specifies a version number of the license which applies
  456.      to it and "any later version", you have the option of following
  457.      the terms and conditions either of that version or of any later
  458.      version published by the Free Software Foundation.  If the
  459.      Program does not specify a version number of the license, you may
  460.      choose any version ever published by the Free Software Foundation.
  461.   9. If you wish to incorporate parts of the Program into other free
  462.      programs whose distribution conditions are different, write to
  463.      the author to ask for permission.  For software which is
  464.      copyrighted by the Free Software Foundation, write to the Free
  465.      Software Foundation; we sometimes make exceptions for this.  Our
  466.      decision will be guided by the two goals of preserving the free
  467.      status of all derivatives of our free software and of promoting
  468.      the sharing and reuse of software generally.
  469.                                   NO WARRANTY
  470.  10. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO
  471.      WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE
  472.      LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
  473.      HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT
  474.      WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT
  475.      NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  476.      FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS TO THE
  477.      QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
  478.      PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY
  479.      SERVICING, REPAIR OR CORRECTION.
  480.  11. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
  481.      WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY
  482.      MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE
  483.      LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL,
  484.      INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
  485.      INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS
  486.      OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
  487.      YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH
  488.      ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN
  489.      ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
  490.                         END OF TERMS AND CONDITIONS
  491. Appendix: How to Apply These Terms to Your New Programs
  492. =======================================================
  493.    If you develop a new program, and you want it to be of the greatest
  494. possible use to humanity, the best way to achieve this is to make it
  495. free software which everyone can redistribute and change under these
  496. terms.
  497.    To do so, attach the following notices to the program.  It is
  498. safest to attach them to the start of each source file to most
  499. effectively convey the exclusion of warranty; and each file should
  500. have at least the "copyright" line and a pointer to where the full
  501. notice is found.
  502.      ONE LINE TO GIVE THE PROGRAM'S NAME AND A BRIEF IDEA OF WHAT IT DOES.
  503.      Copyright (C) 19YY  NAME OF AUTHOR
  504.      
  505.      This program is free software; you can redistribute it and/or modify
  506.      it under the terms of the GNU General Public License as published by
  507.      the Free Software Foundation; either version 1, or (at your option)
  508.      any later version.
  509.      
  510.      This program is distributed in the hope that it will be useful,
  511.      but WITHOUT ANY WARRANTY; without even the implied warranty of
  512.      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  513.      GNU General Public License for more details.
  514.      
  515.      You should have received a copy of the GNU General Public License
  516.      along with this program; if not, write to the Free Software
  517.      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  518.    Also add information on how to contact you by electronic and paper
  519. mail.
  520.    If the program is interactive, make it output a short notice like
  521. this when it starts in an interactive mode:
  522.      Gnomovision version 69, Copyright (C) 19YY NAME OF AUTHOR
  523.      Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
  524.      This is free software, and you are welcome to redistribute it
  525.      under certain conditions; type `show c' for details.
  526.    The hypothetical commands `show w' and `show c' should show the
  527. appropriate parts of the General Public License.  Of course, the
  528. commands you use may be called something other than `show w' and `show
  529. c'; they could even be mouse-clicks or menu items--whatever suits your
  530. program.
  531.    You should also get your employer (if you work as a programmer) or
  532. your school, if any, to sign a "copyright disclaimer" for the program,
  533. if necessary.  Here a sample; alter the names:
  534.      Yoyodyne, Inc., hereby disclaims all copyright interest in the
  535.      program `Gnomovision' (a program to direct compilers to make passes
  536.      at assemblers) written by James Hacker.
  537.      
  538.      SIGNATURE OF TY COON, 1 April 1989
  539.      Ty Coon, President of Vice
  540.    That's all there is to it!
  541. File: emacs,  Node: Intro,  Next: Glossary,  Prev: License,  Up: Top
  542. Introduction
  543. ************
  544.    You are reading about GNU Emacs, the GNU incarnation of the
  545. advanced, self-documenting, customizable, extensible real-time display
  546. editor Emacs.  (The `G' in `GNU' is not silent.)
  547.    We say that Emacs is a "display" editor because normally the text
  548. being edited is visible on the screen and is updated automatically as
  549. you type your commands.  *Note Display: Screen.
  550.    We call it a "real-time" editor because the display is updated very
  551. frequently, usually after each character or pair of characters you
  552. type.  This minimizes the amount of information you must keep in your
  553. head as you edit.  *Note Real-time: Basic.
  554.    We call Emacs advanced because it provides facilities that go beyond
  555. simple insertion and deletion: filling of text; automatic indentation
  556. of programs; viewing two or more files at once; and dealing in terms of
  557. characters, words, lines, sentences, paragraphs, and pages, as well as
  558. expressions and comments in several different programming languages. 
  559. It is much easier to type one command meaning "go to the end of the
  560. paragraph" than to find that spot with simple cursor keys.
  561.    "Self-documenting" means that at any time you can type a special
  562. character, `Control-h', to find out what your options are.  You can
  563. also use it to find out what any command does, or to find all the
  564. commands that pertain to a topic.  *Note Help::.
  565.    "Customizable" means that you can change the definitions of Emacs
  566. commands in little ways.  For example, if you use a programming
  567. language in which comments start with `<**' and end with `**>', you
  568. can tell the Emacs comment manipulation commands to use those strings
  569. (*note Comments::.).  Another sort of customization is rearrangement
  570. of the command set.  For example, if you prefer the four basic cursor
  571. motion commands (up, down, left and right) on keys in a diamond
  572. pattern on the keyboard, you can have it.  *Note Customization::.
  573.    "Extensible" means that you can go beyond simple customization and
  574. write entirely new commands, programs in the Lisp language to be run by
  575. Emacs's own Lisp interpreter.  Emacs is an "on-line extensible" system,
  576. which means that it is divided into many functions that call each
  577. other, any of which can be redefined in the middle of an editing
  578. session.  Any part of Emacs can be replaced without making a separate
  579. copy of all of Emacs.  Most of the editing commands of Emacs are
  580. written in Lisp already; the few exceptions could have been written in
  581. Lisp but are written in C for efficiency.  Although only a programmer
  582. can write an extension, anybody can use it afterward.
  583. File: emacs,  Node: Screen,  Next: Characters,  Prev: Concept Index,  Up: Top
  584. The Organization of the Screen
  585. ******************************
  586.    Emacs divides the screen into several areas, each of which contains
  587. its own sorts of information.  The biggest area, of course, is the one
  588. in which you usually see the text you are editing.
  589.    When you are using Emacs, the screen is divided into a number of
  590. "windows".  Initially there is one text window occupying all but the
  591. last line, plus the special "echo area" or "minibuffer window" in the
  592. last line.  The text window can be subdivided horizontally or
  593. vertically into multiple text windows, each of which can be used for a
  594. different file (*note Windows::.).  The window that the cursor is in
  595. is the "selected window", in which editing takes place.  The other
  596. windows are just for reference unless you select one of them.
  597.    Each text window's last line is a "mode line" which describes what
  598. is going on in that window.  It is in inverse video if the terminal
  599. supports that, and contains text that starts like `-----Emacs:
  600. SOMETHING'.  Its purpose is to indicate what buffer is being displayed
  601. above it in the window; what major and minor modes are in use; and
  602. whether the buffer's text has been changed.
  603. * Menu:
  604. * Point::    The place in the text where editing commands operate.
  605. * Echo Area::   Short messages appear at the bottom of the screen.
  606. * Mode Line::    Interpreting the mode line.
  607. File: emacs,  Node: Point,  Next: Echo Area,  Prev: Screen,  Up: Screen
  608. Point
  609. =====
  610.    When Emacs is running, the terminal's cursor shows the location at
  611. which editing commands will take effect.  This location is called
  612. "point".  Other commands move point through the text, so that you can
  613. edit at different places in it.
  614.    While the cursor appears to point AT a character, point should be
  615. thought of as BETWEEN two characters; it points BEFORE the character
  616. that the cursor appears on top of.  Sometimes people speak of "the
  617. cursor" when they mean "point", or speak of commands that move point as
  618. "cursor motion" commands.
  619.    Terminals have only one cursor, and when output is in progress it
  620. must appear where the typing is being done.  This does not mean that
  621. point is moving.  It is only that Emacs has no way to show you the
  622. location of point except when the terminal is idle.
  623.    If you are editing several files in Emacs, each file has its own
  624. point location.  A file that is not being displayed remembers where
  625. point is so that it can be seen when you look at that file again.
  626.    When there are multiple text windows, each window has its own point
  627. location.  The cursor shows the location of point in the selected
  628. window.  This also is how you can tell which window is selected.  If
  629. the same buffer appears in more than one window, point can be moved in
  630. each window independently.
  631.    The term `point' comes from the character `.', which was the
  632. command in TECO (the language in which the original Emacs was written)
  633. for accessing the value now called `point'.
  634. File: emacs,  Node: Echo Area,  Next: Mode Line,  Prev: Point,  Up: Screen
  635. The Echo Area
  636. =============
  637.    The line at the bottom of the screen (below the mode line) is the
  638. "echo area".  It is used to display small amounts of text for several
  639. purposes.
  640.    "Echoing" means printing out the characters that you type.  Emacs
  641. never echoes single-character commands, and multi-character commands
  642. are echoed only if you pause while typing them.  As soon as you pause
  643. for more than a second in the middle of a command, all the characters
  644. of the command so far are echoed.  This is intended to "prompt" you
  645. for the rest of the command.  Once echoing has started, the rest of
  646. the command is echoed immediately when you type it.  This behavior is
  647. designed to give confident users fast response, while giving hesitant
  648. users maximum feedback.  You can change this behavior by setting a
  649. variable (*note Display Vars::.).
  650.    If a command cannot be executed, it may print an "error message" in
  651. the echo area.  Error messages are accompanied by a beep or by
  652. flashing the screen.  Also, any input you have typed ahead is thrown
  653. away when an error happens.
  654.    Some commands print informative messages in the echo area.  These
  655. messages look much like error messages, but they are not announced
  656. with a beep and do not throw away input.  Sometimes the message tells
  657. you what the command has done, when this is not obvious from looking
  658. at the text being edited.  Sometimes the sole purpose of a command is
  659. to print a message giving you specific information.  For example, the
  660. command `C-x =' is used to print a message describing the character
  661. position of point in the text and its current column in the window. 
  662. Commands that take a long time often display messages ending in `...'
  663. while they are working, and add `done' at the end when they are
  664. finished.
  665.    The echo area is also used to display the "minibuffer", a window
  666. that is used for reading arguments to commands, such as the name of a
  667. file to be edited.  When the minibuffer is in use, the echo area
  668. begins with a prompt string that usually ends with a colon; also, the
  669. cursor appears in that line because it is the selected window.  You
  670. can always get out of the minibuffer by typing `C-g'.  *Note
  671. Minibuffer::.
  672. File: emacs,  Node: Mode Line,  Prev: Echo Area,  Up: Screen
  673. The Mode Line
  674. =============
  675.    Each text window's last line is a "mode line" which describes what
  676. is going on in that window.  When there is only one text window, the
  677. mode line appears right above the echo area.  The mode line is in
  678. inverse video if the terminal supports that, starts and ends with
  679. dashes, and contains text like `Emacs: SOMETHING'.
  680.    If a mode line has something else in place of `Emacs: SOMETHING',
  681. then the window above it is in a special subsystem such as Dired.  The
  682. mode line then indicates the status of the subsystem.
  683.    Normally, the mode line has the following appearance:
  684.      --CH-Emacs: BUF      (MAJOR MINOR)----POS------
  685. This gives information about the buffer being displayed in the window:
  686. the buffer's name, what major and minor modes are in use, whether the
  687. buffer's text has been changed, and how far down the buffer you are
  688. currently looking.
  689.    CH contains two stars `**' if the text in the buffer has been
  690. edited (the buffer is "modified"), or `--' if the buffer has not been
  691. edited.  Exception: for a read-only buffer, it is `%%'.
  692.    BUF is the name of the window's chosen "buffer".  The chosen buffer
  693. in the selected window (the window that the cursor is in) is also
  694. Emacs's selected buffer, the one that editing takes place in.  When we
  695. speak of what some command does to "the buffer", we are talking about
  696. the currently selected buffer.  *Note Buffers::.
  697.    POS tells you whether there is additional text above the top of the
  698. screen, or below the bottom.  If your file is small and it is all on
  699. the screen, POS is `All'.  Otherwise, it is `Top' if you are looking
  700. at the beginning of the file, `Bot' if you are looking at the end of
  701. the file, or `NN%', where NN is the percentage of the file above the
  702. top of the screen.
  703.    MAJOR is the name of the "major mode" in effect in the buffer.  At
  704. any time, each buffer is in one and only one of the possible major
  705. modes.  The major modes available include Fundamental mode (the least
  706. specialized), Text mode, Lisp mode, and C mode.  *Note Major Modes::,
  707. for details of how the modes differ and how to select one.
  708.    MINOR is a list of some of the "minor modes" that are turned on at
  709. the moment in the window's chosen buffer.  `Fill' means that Auto Fill
  710. mode is on.  `Abbrev' means that Word Abbrev mode is on.  `Ovwrt'
  711. means that Overwrite mode is on.  *Note Minor Modes::, for more
  712. information.  `Narrow' means that the buffer being displayed has
  713. editing restricted to only a portion of its text.  This is not really a
  714. minor mode, but is like one.  *Note Narrowing::.  `Def' means that a
  715. keyboard macro is being defined.  *Note Keyboard Macros::.
  716.    Some buffers display additional information after the minor modes. 
  717. For example, Rmail buffers display the current message number and the
  718. total number of messages.  Compilation buffers and Shell mode display
  719. the status of the subprocess.
  720.    In addition, if Emacs is currently inside a recursive editing level,
  721. square brackets (`[...]') appear around the parentheses that surround
  722. the modes.  If Emacs is in one recursive editing level within another,
  723. double square brackets appear, and so on.  Since this information
  724. pertains to Emacs in general and not to any one buffer, the square
  725. brackets appear in every mode line on the screen or not in any of them. 
  726. *Note Recursive Edit::.
  727.    Emacs can optionally display the time and system load in all mode
  728. lines.  To enable this feature, type `M-x display-time'.  The
  729. information added to the mode line usually appears after the file
  730. name, before the mode names and their parentheses.  It looks like this:
  731.      HH:MMpm L.LL [D]
  732. (Some fields may be missing if your operating system cannot support
  733. them.) HH and MM are the hour and minute, followed always by `am' or
  734. `pm'.  L.LL is the average number of running processes in the whole
  735. system recently.  D is an approximate index of the ratio of disk
  736. activity to cpu activity for all users.
  737.    The word `Mail' appears after the load level if there is mail for
  738. you that you have not read yet.
  739.    Customization note: the variable `mode-line-inverse-video' controls
  740. whether the mode line is displayed in inverse video (assuming the
  741. terminal supports it); `nil' means no inverse video.  The default is
  742. File: emacs,  Node: Characters,  Next: Keys,  Prev: Screen,  Up: Top
  743. The Emacs Character Set
  744. =======================
  745.    GNU Emacs uses the ASCII character set, which defines 128 different
  746. character codes.  Some of these codes are assigned graphic symbols such
  747. as `a' and `='; the rest are control characters, such as `Control-a'
  748. (also called `C-a' for short).  `C-a' gets its name from the fact that
  749. you type it by holding down the CTRL key and then pressing `a'.  There
  750. is no distinction between `C-a' and `C-A'; they are the same character.
  751.    Some control characters have special names, and special keys you can
  752. type them with: RET, TAB, LFD, DEL and ESC.  The space character is
  753. usually referred to below as SPC, even though strictly speaking it is
  754. a graphic character whose graphic happens to be blank.
  755.    Emacs extends the 7-bit ASCII code to an 8-bit code by adding an
  756. extra bit to each character.  This makes 256 possible command
  757. characters.  The additional bit is called Meta.  Any ASCII character
  758. can be made Meta; examples of Meta characters include `Meta-a' (`M-a',
  759. for short), `M-A' (not the same character as `M-a', but those two
  760. characters normally have the same meaning in Emacs), `M-RET', and
  761. `M-C-a'.  For traditional reasons, `M-C-a' is usually called `C-M-a';
  762. logically speaking, the order in which the modifier keys CTRL and META
  763. are mentioned does not matter.
  764.    Some terminals have a META key, and allow you to type Meta
  765. characters by holding this key down.  Thus, `Meta-a' is typed by
  766. holding down META and pressing `a'.  The META key works much like the
  767. SHIFT key.  Such a key is not always labeled META, however, as this
  768. function is often a special option for a key with some other primary
  769. purpose.
  770.    If there is no META key, you can still type Meta characters using
  771. two-character sequences starting with ESC.  Thus, to enter `M-a', you
  772. could type `ESC a'.  To enter `C-M-a', you would type `ESC C-a'.  ESC
  773. is allowed on terminals with Meta keys, too, in case you have formed a
  774. habit of using it.
  775.    Emacs believes the terminal has a META key if the variable
  776. `meta-flag' is non-`nil'.  Normally this is set automatically
  777. according to the termcap entry for your terminal type.  However,
  778. sometimes the termcap entry is wrong, and then it is useful to set
  779. this variable yourself.  *Note Variables::, for how to do this.
  780.    Emacs buffers also use an 8-bit character set, because bytes have 8
  781. bits, but only the ASCII characters are considered meaningful.  ASCII
  782. graphic characters in Emacs buffers are displayed with their graphics.
  783.  LFD is the same as a newline character; it is displayed by starting a
  784. new line.  TAB is displayed by moving to the next tab stop column
  785. (usually every 8 columns).  Other control characters are displayed as
  786. a caret (`^') followed by the non-control version of the character;
  787. thus, `C-a' is displayed as `^A'.  Non-ASCII characters 128 and up are
  788. displayed with octal escape sequences; thus, character code 243
  789. (octal), also called `M-#' when used as an input character, is
  790. displayed as `\243'.
  791. File: emacs,  Node: Keys,  Next: Commands,  Prev: Characters,  Up: Top
  792.    A "complete key"--where `key' is short for "key sequence"--is a
  793. sequence of keystrokes that are understood by Emacs as a unit, as a
  794. single command (possibly undefined).  Most single characters
  795. constitute complete keys in the standard Emacs command set; there are
  796. also some multi-character keys.  Examples of complete keys are `C-a',
  797. `X', RET, `C-x C-f' and `C-x 4 C-f'.
  798.    A "prefix key" is a sequence of keystrokes that are the beginning of
  799. a complete key, but not a whole one.  Prefix keys and complete keys are
  800. collectively called "keys".
  801.    A prefix key is the beginning of a series of longer sequences that
  802. are valid keys; adding any single character to the end of the prefix
  803. gives a valid key, which could be defined as an Emacs command, or
  804. could be a prefix itself.  For example, `C-x' is standardly defined as
  805. a prefix, so `C-x' and the next input character combine to make a
  806. two-character key.  There are 256 different two-character keys
  807. starting with `C-x', one for each possible second character.  Many of
  808. these two-character keys starting with `C-x' are standardly defined as
  809. Emacs commands.  Notable examples include `C-x C-f' and `C-x s' (*note
  810. Files::.).
  811.    Adding one character to a prefix key does not have to form a
  812. complete key.  It could make another, longer prefix.  For example,
  813. `C-x 4' is itself a prefix that leads to 256 different three-character
  814. keys, including `C-x 4 f', `C-x 4 b' and so on.  It would be possible
  815. to define one of those three-character sequences as a prefix, creating
  816. a series of four-character keys, but we did not define any of them
  817. this way.
  818.    By contrast, the two-character sequence `C-f C-k' is not a key,
  819. because the `C-f' is a complete key in itself.  It's impossible to give
  820. `C-f C-k' an independent meaning as a command as long as `C-f' retains
  821. its meaning.  `C-f C-k' is two commands.
  822.    All told, the prefix keys in Emacs are `C-c', `C-x', `C-h', `C-x
  823. 4', and ESC.  But this is not built in; it is just a matter of Emacs's
  824. standard key bindings.  In customizing Emacs, you could make new
  825. prefix keys, or eliminate these.  *Note Key Bindings::.
  826.    Whether a sequence is a key can be changed by customization.  For
  827. example, if you redefine `C-f' as a prefix, `C-f C-k' automatically
  828. becomes a key (complete, unless you define it too as a prefix). 
  829. Conversely, if you remove the prefix definition of `C-x 4', then `C-x
  830. 4 f' (or `C-x 4 ANYTHING') is no longer a key.
  831.